<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../common.jsp"%>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>抢购列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="${ctx}/css/public.css" media="all" />
</head>
<body class="childrenBody">
<form class="layui-form">
    <blockquote class="layui-elem-quote quoteBox">
        <form class="layui-form">
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <input type="text" class="layui-input userName" placeholder="用户名称" />
                </div>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input userPhone" placeholder="手机号" />
                </div>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input parkNo" placeholder="车位编号" />
                </div>
                <a class="layui-btn search_btn" data-type="reload">搜索</a>
        </form>
    </blockquote>
    <table id="adminList" lay-filter="adminList"></table>
</form>
<!--操作-->
<script type="text/html" id="adminListBar">
</script>

<script type="text/javascript" src="${ctx}/layui/layui.js"></script>
<script>
    layui.use(['form', 'layer', 'table', 'laytpl', 'laydate'], function () {
        var form = layui.form,
            layer = parent.layer === undefined ? layui.layer : top.layer,
            $ = layui.jquery,
            laytpl = layui.laytpl,
            table = layui.table,
            laydate = layui.laydate;
           var e = layui.$;


        //分页列表
        var tableIns = table.render({
            elem: '#adminList',
            url: '${ctx}/his/page',
            cellMinWidth: 95,
            page: true,
            height: "full-125",
            loading: true,
            id: "adminListTable",
            request: {
                pageName: 'pageNumber' //页码的参数名称，默认：page
                ,limitName: 'pageSize' //每页数据量的参数名，默认：limit
            },
            response: {
                statusName: 'code' //规定数据状态的字段名称，默认：code
                ,statusCode: 10200 //规定成功的状态码，默认：0
                ,msgName: 'message' //规定状态信息的字段名称，默认：msg
                ,countName: 'total' //规定数据总数的字段名称，默认：count
                ,dataName: 'records' //规定数据列表的字段名称，默认：data
            },
            cols: [[
                {field: 'parkNo', title: '车位编号', minWidth: 100, align: "center"},
                {field: 'parkPrice', title: '车位价格', minWidth: 100, align: "center"},
                {field: 'userName', title: '用户名称', minWidth: 100, align: "center"},
                {field: 'userPhone', title: '用户手机号', minWidth: 100, align: "center"},
                {field: 'createTime', title: '抢购时间', minWidth: 100, align: "center"}
            ]]
        });


        //搜索【此功能需要后台配合，所以暂时没有动态效果演示】
        $(".search_btn").on("click", function () {
            tableIns.reload({
                page: {
                    curr: 1 //重新从第 1 页开始
                },
                where: { //设定异步数据接口的额外参数，任意设
                    parkNo: $(".parkNo").val(),
                    userName: $(".userName").val(),
                    userPhone: $(".userPhone").val()
                }
            })
        });

    })
</script>
</body>
</html>
